package com.test.springCloud.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
* @author:LuoXingFa;
* @version:Date:2022年7月22日下午2:44:50
*/


public class DateUtil {

	public static final String HH = "HH";
	public static final String YYYY_MM_DD = "yyyy-MM-dd";
	public static final DateTimeFormatter FORMATTER_HH =DateTimeFormatter.ofPattern(HH);
	public static final DateTimeFormatter FORMATTER_YYYY_MM_DD = DateTimeFormatter.ofPattern(YYYY_MM_DD);
	
	public static String getHH() {
		return FORMATTER_HH.format(LocalDateTime.now());//获取当前时间的小时
	}
	
	public static String getYMD() {
		return FORMATTER_YYYY_MM_DD.format(LocalDateTime.now());//获取当前时间的年月日
	}
}
